package cn.com.yusys.yusp.message.service;

import java.util.List;
import java.util.Map;

import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.service.CommonService;
import cn.com.yusys.yusp.message.domain.MessageSubscribe;
import cn.com.yusys.yusp.message.domain.MessageTemp;

public abstract class MessageTypeService extends CommonService{
	public abstract List<Map<String,Object>> queryMessageType(QueryModel queryModel);
	public abstract int addOrUpdateTemplate(MessageTemp messageTemp);
	public abstract int deleteTemplate(MessageTemp messageTemp);
	public abstract MessageTemp getTemplateInfo(MessageTemp messageTemp);
	public abstract List<Map<String,Object>> queryMessageTypeAndChannel(QueryModel queryModel);
	public abstract List<MessageSubscribe> getSubscribeInfo(MessageSubscribe messageSubscribe);
	public abstract int deleteAllMessageSubscribe(MessageSubscribe messageSubscribe);	
	public abstract void addOrUpdateMessageSubscribe(MessageSubscribe messageSubscribe);	
	public abstract List<Map<String,Object>> queryMessageResult(QueryModel queryModel);
	public abstract List<Map<String,Object>> queryMessagePool(QueryModel queryModel);
	public abstract int sendAgain(String[] pkNos);	
	public abstract int top(String[] pkNos);	
	
	
	/**
	 * 发送实时消息【使用模板】
	 * @param messageType 消息标识 
	 * @param channelType 渠道类型，不指定则只要渠道配了都发
	 * @param users 发送用户唯一id,多个用逗号隔开
	 * @param param 模板参数
	 * @return
	 */
	public abstract void sendRealTimeMessageWithTemplate(String messageType,String channelType,String users, Map<String,Object> param);
	
	/**
	 * 发送实时消息【不使用模板】
	 * @param channelType 渠道类型
	 * @param users  发送用户唯一id,多个用逗号隔开
	 * @param msg 消息内容
	 * @param param 标题、开始结束时间段 {"title":"","timeStart":"03:45","timeEnd":"12:03"}
	 */
	public abstract void sendRealTimeMessageWithOutTemplate(String channelType,String users,String msg,Map<String,String> param);
	
	/**
	 * 发送订阅消息
	 * @param messageType 消息标识
	 * @param param 模板参数
	 * @return
	 */
	public abstract void sendSubscribeMessage(String messageType,String channelType, Map<String,Object> param);
	
}
